package spynx.desl.runtime.operators.impl;

import spynx.desl.Statement;
import spynx.desl.runtime.IExecutionContext;
import spynx.desl.runtime.IOperator;

public class ExecuteOperator implements IOperator {

	@Override
	public String getOperator() {
		return "execute";
	}

	@Override
	public Object apply(IExecutionContext context, String operator,
			Object... args) {
		Object value = context.resolveValue(args[0]);
		return value instanceof Statement ? ((Statement) value).execute(context) : value ;
	}

}
